package com.ss.android.article.base.feature.search;

import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.AutoCompleteTextView;

public class SSAutoCompleteTextView extends AutoCompleteTextView {
    private boolean a;
    private boolean b;

    public SSAutoCompleteTextView(Context arg2) {
        super(arg2);
        this.a = false;
        this.b = false;
    }

    public SSAutoCompleteTextView(Context arg2, AttributeSet arg3) {
        super(arg2, arg3);
        this.a = false;
        this.b = false;
    }

    public SSAutoCompleteTextView(Context arg2, AttributeSet arg3, int arg4) {
        super(arg2, arg3, arg4);
        this.a = false;
        this.b = false;
    }

    public boolean enoughToFilter() {
        boolean v0;
        if(this.a) {
            v0 = false;
        }
        else {
            if(this.getText() != null && this.getText().length() != 0) {
                return super.enoughToFilter();
            }

            v0 = true;
        }

        return v0;
    }

    protected void onFocusChanged(boolean arg2, int arg3, Rect arg4) {
        if((arg2) && this.getText() != null) {
            this.getText().length();
        }

        super.onFocusChanged(arg2, arg3, arg4);
    }

    public void onWindowFocusChanged(boolean arg2) {
        if(!this.b || (arg2)) {
            super.onWindowFocusChanged(arg2);
        }
    }

    public void setDropDownAlwaysVisiable(boolean arg1) {
        this.b = arg1;
    }

    public void setIsLoading(boolean arg1) {
        this.a = arg1;
    }
}

